﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Himp.Platform.Dc.Migrations
{
    /// <inheritdoc />
    public partial class addtableRX_USED_FRQU : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "USED_FRQU_DICT",
                schema: "Dc");

            migrationBuilder.CreateTable(
                name: "DRUG_PRDR",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    PRDR_CODG = table.Column<string>(type: "text", nullable: false),
                    PRDR_NAME = table.Column<string>(type: "text", nullable: false),
                    PINYINCODE = table.Column<string>(type: "text", nullable: false),
                    CONER = table.Column<string>(type: "text", nullable: true),
                    TEL = table.Column<string>(type: "text", nullable: true),
                    CHKER_CODG = table.Column<string>(type: "text", nullable: true),
                    CHKER_NAME = table.Column<string>(type: "text", nullable: true),
                    CHK_TIME = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
                    VALI_FLAG = table.Column<bool>(type: "boolean", nullable: false),
                    TenantId = table.Column<Guid>(type: "uuid", nullable: true),
                    IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DRUG_PRDR", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "RX_USED_FRQU",
                schema: "Dc",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    RX_USED_FRQU_CODG = table.Column<string>(type: "text", nullable: false),
                    RX_USED_FRQU_NAME = table.Column<string>(type: "text", nullable: false),
                    DSCR = table.Column<string>(type: "text", nullable: false),
                    PRD = table.Column<int>(type: "integer", nullable: false),
                    CNT = table.Column<int>(type: "integer", nullable: false),
                    RX_USED_FRQU_TYPE_CODE = table.Column<string>(type: "text", nullable: false),
                    RX_USED_FRQU_TYPE_NAME = table.Column<string>(type: "text", nullable: false),
                    DATA_DICT_CODE = table.Column<string>(type: "text", nullable: false),
                    DATA_DICT_NAME = table.Column<string>(type: "text", nullable: false),
                    TenantId = table.Column<Guid>(type: "uuid", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RX_USED_FRQU", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "DRUG_PRDR");

            migrationBuilder.DropTable(
                name: "RX_USED_FRQU",
                schema: "Dc");

            migrationBuilder.CreateTable(
                name: "USED_FRQU_DICT",
                schema: "Dc",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    CNT = table.Column<int>(type: "integer", nullable: false),
                    DATA_DICT_CODE = table.Column<string>(type: "text", nullable: false),
                    DATA_DICT_NAME = table.Column<string>(type: "text", nullable: false),
                    DSCR = table.Column<string>(type: "text", nullable: false),
                    PRD = table.Column<int>(type: "integer", nullable: false),
                    TenantId = table.Column<Guid>(type: "uuid", nullable: true),
                    USED_FRQU_CODG = table.Column<string>(type: "text", nullable: false),
                    USED_FRQU_NAME = table.Column<string>(type: "text", nullable: false),
                    USED_FRQU_TYPE_CODE = table.Column<string>(type: "text", nullable: false),
                    USED_FRQU_TYPE_NAME = table.Column<string>(type: "text", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_USED_FRQU_DICT", x => x.Id);
                });
        }
    }
}
